package cn.itcast.nems.base.web.controller.o;

import cn.itcast.nems.common.web.controller.b.PaymentTypeController;
import cn.itcast.nems.common.web.vo.BasePageRequest;
import cn.itcast.nems.common.web.vo.DictionaryQueryVO;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

/**
 * <p>
 * 报名页面-付款方式查询
 * </p>
 *
 * @author zhouwei
 * @since 2023/9/10 10:57 AM
 **/
@RestController
@RequestMapping("/o/payment_type")
public class EnrolPaymentTypeController extends PaymentTypeController {

    /**
     * 报名页面-付款方式分页查询
     * @param queryParam 请求参数
     * @return 分页结果
     */
    @Override
    public ResponseEntity<?> pageList(@RequestBody BasePageRequest<DictionaryQueryVO<?>> queryParam) {
        DictionaryQueryVO<?> queryVO = Objects.nonNull(queryParam.getCondition()) ? queryParam.getCondition(): new DictionaryQueryVO<>();
        queryVO.setState(1);
        queryParam.setCondition(queryVO);
        return super.pageList(queryParam) ;
    }
}
